Skip to main content
POST
/
v1
/
axons
/
{id}
/
sql
/
query
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});

const sqlQueryResultView = await client.axons.sql.query('id', { sql: 'sql' });

console.log(sqlQueryResultView.columns);
{
  "columns": [
    {
      "name": "<string>",
      "type": "<string>"
    }
  ],
  "rows": [
    {}
  ],
  "meta": {
    "duration_ms": 123,
    "changes": 123,
    "rows_read_limit_reached": true
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The axon identifier.

Body

application/json
sql
string
required

SQL query with ?-style positional placeholders.

params
object[]

Positional parameter bindings for ? placeholders.

Response

200 - application/json

OK

columns
object[]
required

Column metadata.

rows
object[]
required

Result rows (empty for non-SELECT statements).

meta
object
required

Execution metadata.